package com.itheima.cas;

import java.util.concurrent.atomic.AtomicInteger;

public class Demo01 {

    public static void main(String[] args) {

        AtomicInteger ac = new AtomicInteger(100);
        System.out.println(ac.get());
      /*  int i1 = ac.getAndIncrement();
        int i2 = ac.incrementAndGet();
        System.out.println(i1);
        System.out.println(i2);
        System.out.println(ac.get());*/
       // int i = ac.addAndGet(100);
     /*   int i = ac.getAndAdd(100);
        System.out.println(i);
        System.out.println(ac.get());*/

      /*  int i = ac.getAndSet(20);
        System.out.println(i);
        System.out.println(ac.get());*/

        boolean b = ac.compareAndSet(200, 200);
        System.out.println(b);
        System.out.println(ac.get());
    }
}
